<%@ page contentType="text/html; charset=utf-8"%>
<%@ include file="/jsp/inc/header.jsp" %>
<c:set var="title" value="频道"/>
<c:set var="rootpath" value="${CONTEXT_PATH}/admin/site/channel/"/>
<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <link href="${STATIC_HOST}/css/ligerui.css" rel="stylesheet" type="text/css"/>
    <link href="${STATIC_HOST}/css/common.css" rel="stylesheet" type="text/css" />
    <script src="${STATIC_HOST}/js/common.js" type="text/javascript"></script>
    <script src="${STATIC_HOST}/js/LG.js" type="text/javascript"></script>
    <title>${title}管理</title>
</head>
<body>
<form:form commandName="channel" class="l-form" id="mainform" name="mainform" method="post" action="${rootpath}/save.do">
  <div class="l-group l-group-hasicon"><img src="${STATIC_HOST}/images/common/communication.gif"><span>当前位置: 宇宙CMS &gt; <a href="${rootpath}/list.do">${title}管理</a> &gt; ${channel.id==0 ? '新增' : '修改'}${title}</span></div>
    <div id="errorLabelContainer"> <form:errors path="*"/></div>
        <input type="hidden" name="queryParam" value="${queryParam}"/>
		<input type="hidden" name="id" id="id" value="${channel.id}"/>
		
      <ul>
      <li class="li_show_left" style="padding-left:30px;"><label for="siteId">站点ID</label> <span style="color:red">*</span>:</li>
           <li class="li_show_right">
               <input type="text" name="siteId" id="siteId" size="10" ltype='text' ligerui='{"width":150}'  value="${channel.siteId}"/>
               <input value="..." type="button" class="l-button ellipsis"  onclick="f_select({'targetId':'siteId','selectType':'/admin/site/site'})">
           <span class='formValidatorError'><form:errors path="siteId" /></span>
      </li>
      </ul><!--换行-->
      <ul>
      <li class="li_show_left" style="padding-left:30px;"><label for="name">频道名称</label> <span style="color:red">*</span>:</li>
           <li class="li_show_right">
        <input type="text" name="name" id="name" size="60" maxlength="100" ltype='text'  validate="{required:true,minlength:0,maxlength:100}" value="${channel.name}"/>
       <span class='formValidatorError'><form:errors path="name" /></span>
      </li>
      </ul>
    <ul>
        <li class="li_show_left" style="padding-left:30px;"><label for="code">频道代号</label> <span style="color:red">*</span>:</li>
        <li class="li_show_right">
            <input type="text" name="code" id="code" size="60" maxlength="100" ltype='text'  validate="{required:true,minlength:0,maxlength:100}" value="${channel.code}"/>
            <span class='formValidatorError'><form:errors path="code" /></span>
        </li>
      <li class="li_show_left" style="padding-left:30px;"><label for="host">频道域名</label> <span style="color:red">*</span>:</li>
           <li class="li_show_right">
        <input type="text" name="host" id="host" size="60" maxlength="100" ltype='text'  validate="{required:true,minlength:0,maxlength:100}" value="${channel.host}" ${channel.id==0 ? '' : 'readonly'}/>
       <span class='formValidatorError'><form:errors path="host" /></span>
      </li>
    </ul>
      <ul>
      <li class="li_show_left" style="padding-left:30px;"><label for="path">保存路径</label> <span style="color:red">*</span>:</li>
           <li class="li_show_right">
        <input type="text" name="path" id="path" size="60" maxlength="100" ltype='text' readonly  validate="{required:true,minlength:0,maxlength:100}" value="${channel.path}"/>
       <span class='formValidatorError'><form:errors path="path" /></span>
      </li>
      <li class="li_show_left" style="padding-left:30px;"><label for="url">访问url</label> <span style="color:red">*</span>:</li>
           <li class="li_show_right">
        <input type="text" name="url" id="url" size="60" maxlength="100" ltype='text' readonly  validate="{required:true,minlength:0,maxlength:100}" value="${channel.url}"/>
       <span class='formValidatorError'><form:errors path="url" /></span>
      </li>
    </ul>
    <ul>
        <li class="li_show_left" style="padding-left:30px;"><label for="indexTemplateId">频道首页</label> <span style="color:red">*</span>:</li>
        <li class="li_show_right">
            <input type="text" name="indexTemplateId" id="indexTemplateId" size="10" ltype='text' ligerui='{"width":150}'  value="${channel.indexTemplateId}"/>
            <input value="..." type="button" class="l-button ellipsis"  onclick="f_select({'targetId':'indexTemplateId','selectType':'/admin/template/template'})">
            <span class='formValidatorError'><form:errors path="indexTemplateId" /></span>
        </li>
    </ul><!--换行-->
    <ul>
        <li class="li_show_left" style="padding-left:30px;"><label for="status">状态</label> <span style="color:red">*</span>:</li>
        <li class="li_show_right">
            <select name="status" id="status" ltype="select" size="1" >
                <c:forEach var="obj" items="${statusMap}" varStatus="idx">
                    <option value="${obj.key}" <c:if test="${channel.status==obj.key}">selected</c:if>>${obj.value}</option>
                </c:forEach>
            </select>
        </li>
    </ul>
      <div class="l-group l-group-hasicon"><div class="togglebtn togglebtn-left"></div><span>其他信息</span><div class="togglebtn"></div></div><!--分组-->
      <div class="div-group">
      <ul>
      <li class="li_show_left" style="padding-left:30px;"><label for="metaKeyword">SEO关键词</label> <span style="color:red">*</span>:</li>
           <li class="li_show_right">
           <textarea name="metaKeyword" id="metaKeyword" rows="3" cols="80" class="l-textarea" validate="{minlength:0,maxlength:420}">${channel.metaKeyword}</textarea>
       <span class='formValidatorError'><form:errors path="metaKeyword" /></span>
      </li>
      </ul><!--换行-->
          <ul>
      <li class="li_show_left" style="padding-left:30px;"><label for="metaDescription">SEO描述</label> <span style="color:red">*</span>:</li>
           <li class="li_show_right">
           <textarea name="metaDescription" id="metaDescription" rows="3" cols="80" class="l-textarea" validate="{minlength:0,maxlength:420}">${channel.metaDescription}</textarea>
       <span class='formValidatorError'><form:errors path="metaDescription" /></span>
      </li>
          </ul>
      <ul>
      <li class="li_show_left" style="padding-left:30px;"><label for="memo">备注</label> <span style="color:red">*</span>:</li>
           <li class="li_show_right">
           <textarea name="memo" id="memo" rows="3" cols="80" class="l-textarea" validate="{minlength:0,maxlength:420}">${channel.memo}</textarea>
       <span class='formValidatorError'><form:errors path="memo" /></span>
      </li>
      </ul><!--换行-->
      </div>

  <div class="l-group l-group-hasicon"></div>
  <input type="submit" value="提交" id="mainformsubmit" class="l-button l-button-submit form_submit_button"/> 
  <c:if test="${fn:contains(header.referer,rootpath)}"><input type="button" value="返回" class="l-button l-button-test" style="float:left;" onClick="location.href='${header.referer}'" /></c:if>
</form:form>
<script type="text/javascript" >
var mainform = $("#mainform");
mainform.ligerForm();

$(function(){
	$("#host").bind('keyup', function (){
        var temp = "${channel.path}";
        var path = temp+$("#host").val();
        var url = "http://"+$("#host").val();
        $("#path").val(path);
        $("#url").val(url);
	});
});

</script>
<div id="scrolltop">返回顶部</div>
<%@ include file="/jsp/inc/footer.jsp"%>
</body>
</html>